FIG. 10 is a block diagram showing configuration of a time control device based on the conventional technology. A time control device 40 shown in FIG. 10 is connected to an external time source 30, and provides stepping control by receiving time data indicating a reference time and a second pulse (1 second interval) for adjusting timing of such operations as correction (1 second interval). It should be noted that the external time source 30 is a device that transmits a reference time from time reporting service or the like by way of standard electric wave or through a telephone line.
The time control device 40 comprises, as shown in FIG. 10, an oscillator 41 oscillating a reference clock with a fixed frequency, a timer 42 for stepping the internal time, a sampling register 43 for sampling the time counted by the timer 42 according to second pulses received from the external time source 30, a comparing circuit 44 for obtaining an error (.DELTA.T) and advance or delay in stepping by comparing a sampling value obtained by the sampling register 43 to a reference time (time data) value supplied from the external time source 30, and a correcting circuit 45 for doubling a speed of the time count of the timer 42 or stopping the time count based on the error (.DELTA.T) and advance or delay in stepping transmitted from the comparing circuit 44 in order to correct the internal time.
Next, description is made for operations. In the time control device 40 shown in FIG. 10, second pulses oscillated from the external time source 30 and time data are sent to the sampling register 43 and the comparator 44, respectively. The second pulses are periodically transmitted to the sampling register 43 at an interval of 1 second. For this reason, time data of the timer 42 is sampled at an interval of 1 second in the sampling register 43.
In the comparing circuit 44, time data oscillated from the external time source 30 and time data sampled by the sampling register 43 are fetched, and the two time datas are compared to each other. Time obtained by the timer 42 is subtracted from the reference time provided by the external time source 30, and if the error (.DELTA.T) as a result of comparison is plus, it is determined that the time in the timer 42 is delayed from the reference time, and if the error is minus, it is determined that the time in the timer 42 is advancing from the reference time.
As described above, the error (.DELTA.T) or information on advance or delay obtained by the comparing circuit 44 is supplied to the correcting circuit 45. In the correcting circuit 45, when it is determined that the time in the timer 42 is advancing, stop control is provided so that the timer 42 is delayed by the error (.DELTA.T), and when it is determined that the time in the timer 42 is delayed, double speed control is provided so that the timer 42 is advanced by the error (.DELTA.T). Herein the stop control is defined as a control for stopping counting of the reference clock oscillated by the oscillator 41, and the double speed control is defined as control for counting the reference clock oscillated by the oscillator 41 at a higher speed.
As described above, the timer 42 is controlled by executing the double speed control or stop control so that the timer 42 steps at the same time as the reference time supplied from the external time source 30.
As a technology analogous to the time control described above, there is the technology disclosed in, for instance, Japanese Patent Laid-Open Publication No. SHO 58-16319. Disclosed in this patent publication is a technology for sending an external clock from an upper computer to a lower computer to adjust the time of the lower computer.
In the time control device based on the conventional technology as described above, when any trouble occurs in the oscillator that operates the timer, stepping under time control may become inaccurate or may stop, and time can not be provided with high precision. Especially, when the oscillator occurs, stepping control over time can not provided, so that the entire system is affected.
Also, in the system, control over the internal time is provided according to the time supplied from an external time source, so that, when the external time source goes wrong, the failure can not be detected, and time correction is executed following an incorrect time supplied from the external time source. In this case, the entire system operates according to a wrong time, which may affect the operations of the entire system.
Also, when any trouble exceeding the precision of the external time source or the internal oscillator occurs, an error in stepping of the time becomes unnecessarily larger, and a correction rate in the correcting circuit also becomes larger. For this reason, satisfactory precision in correction can not be realized by the correcting circuit, or correction itself become impossible, or an extremely long time is required for correction, which makes it possible to realize real time correction.
As described above, when a trouble occurs in the external time source or the oscillator and the trouble is out of the controllable precision range, the cause can not be clarified and the entire system is affected, so that precision or reliability of the internal time becomes disadvantageously lower.